namespace cpp imserver

enum ImMessageFlag {
  IM_MESSAGE_RECEIVED = 1,
  IM_MESSAGE_READ = 2
}

// 千位及以上表示业务类型，千位以下表示view类型
enum ImMessageType {
  IM_MESSAGE_P2P = 1001,
  IM_MESSAGE_TYPING = 1002,
  IM_MESSAGE_RESUME = 1003,
  IM_MESSAGE_RESUME_LIKE = 1005,
  IM_MESSAGE_RESUME_IGNORE = 1006,
  IM_MESSAGE_JOB_INVITATION = 1007,

  IM_MESSAGE_GROUP = 2001,
  IM_MESSAGE_GROUP_JOIN = 2004,
  IM_MESSAGE_GROUP_RESUME_LIKE = 2005,
  IM_MESSAGE_GROUP_JOB_INVITATION = 2007,

  IM_MESSAGE_LOGIN = 9990,
  IM_MESSAGE_READ_ERROR_DATA = 9991
}

const string IM_MESSAGE_LOGIN_OK_BODY = "登录成功"
const string IM_MESSAGE_LOGIN_FAILED_BODY = "登录失败"
const string IM_MESSAGE_KICK_BODY = "您的帐户已在其他手机上线，您被强制下线"
const string IM_MESSAGE_READ_ERROR_DATA_BODY = "回执数据格式错误"

const string IM_MESSAGE_RESUME_SUMMARY = "[简历]"
const string IM_MESSAGE_JOB_INVITATION_SUMMARY = "[职位邀请]"
const string IM_MESSAGE_GROUP_JOIN_TEXT_FORMAT = "%s投递了职位"
const string IM_MESSAGE_RESUME_LIKE_TEXT_FORMAT = "%s赞了你的简历"
const string IM_MESSAGE_RESUME_IGNORE_TEXT_FORMAT = "%s忽略了你的简历"

struct ImMessage {
  1: required i64 id;
  2: required i32 type;
  3: required i64 sender;
  4: required i64 receiver;
  5: required i64 dialogue_id;
  6: required i64 timestamp;
  7: required i32 flags;
  8: required string body;
  9: required i64 group_id;
  10: required i64 topic_id;
}

typedef list<ImMessage> ImMessageList

